package ai.zixing.command01;

public class Client {

    public static void main(String[] args) {
        Order order1 = new Order();
        order1.setDiningTable(1);
        order1.getFoodMenu().put("鲍鱼炒饭", 1);
        order1.getFoodMenu().put("茅台迎宾", 1);

        Order order2 = new Order();
        order2.setDiningTable(3);
        order2.getFoodMenu().put("海参炒面", 1);
        order2.getFoodMenu().put("五粮液", 1);

        // 创建接受者
        Chef chef = new Chef();

        //将订单和接收者封装成命令对象
        OrderCommand cmd1 = new OrderCommand(chef, order1);
        OrderCommand cmd2 = new OrderCommand(chef, order2);

        //创建调用者
        Waiter invoke = new Waiter();
        invoke.setCommand(cmd1);
        invoke.setCommand(cmd2);

        //将订单发送到后厨
        invoke.orderUp();
    }
}
